<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>【${examination.title}】成绩单</title>
<%@include file="../core/head.jsp"%>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="${ctx }/css/core.css" type="text/css">
<link rel="stylesheet" href="${ctx }/css/exam.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/buttons.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/table.css" type="text/css">
<script type="text/javascript" src="${ctx}/js/modules/code/AjaxAuthFilter.js"></script>
<link rel="stylesheet" href="${ctx}/js/jquery-ui-1.10.3/css/ui-lightness/jquery-ui-1.10.3.custom.css" type="text/css">
<script type="text/javascript" src="${ctx }/js/jquery-ui-1.10.3/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="${ctx }/js/modules/code/MessageBox.js"></script>

<script type="text/javascript" src="${ctx }/js/FusionCharts.js"></script>
<script type="text/javascript">
	 	function showQuestion(boo,clname){
	 		
	 		$(clname).each(function(index,item){
	 			if(boo){
		 			$(item).show();
	 				
	 			}else{
	 				$(item).hide();
	 			}
	 		});
	 	}
	 		 
	 	 
	 	
   /*  $(function(){
		var staticInfos =  ${staticInfos_json} 
		 var myChart = new FusionCharts("${ctx}/charts/Column3D.swf", "myChartId", "100%", 400);    
		 
		var dataxml = "<chart   decimals='1' showLabels='1' useRoundEdges='1' formatNumberScale='0' baseFont='宋体' showValues='1' caption='试题分布' pieSliceDepth='20' baseFontSize='12'     pieRadius='130' >";
		for(i in staticInfos){
			var info = staticInfos[i];
			dataxml=dataxml+"<set name='" +info.title+"' value='"+info.num+"'  />";
		 }
		dataxml= dataxml+ "</chart>";
		myChart.setDataXML(dataxml);    
		myChart.render("chartdiv");
     });
     */ 
   </script> 
 <style type="text/css">
 .score{
 	font-size: 55px;
 	font-weight:bold;
 	color: red;
 	text-align: center;
 }
 
 </style>
</head>

<body>
	<%@include file="top.jsp"%>
	<div class="width center menuPanel radius">
		<div class="context center">
		<div class="examname">
			<h1>【${examination.title}】成绩单</h1>
		</div>
		<div>		
			 <div id="chartdiv" align="center" > </div>
		</div>
		<div class="center radius shadow" style="background: #ccc;padding:5px;">
		<table class="dtable radius " style="width:100%;" border="0" cellpadding="0" cellspacing="1">
			<tr><th>章节</th><th>题数</th><th>正确</th><th>错误</th><th>正确率</th><th>总成绩</th></tr>		
			
			<c:forEach var ="staticinfo" varStatus="tem"  items="${staticInfos }">
				<tr>
				<td>${staticinfo.value.title}</td>
				<td>${staticinfo.value.num+staticinfo.value.right}</td>
				<td>${staticinfo.value.right}</td>
				<td>${staticinfo.value.num}</td>
				<td><fmt:formatNumber type="percent" value="${staticinfo.value.right/(staticinfo.value.num+staticinfo.value.right) }"/></td>
					<c:if test="${tem.index==0 }">
						<td rowspan="${fn:length(staticInfos) }" align="center" >
						<div class="score">
							<fmt:formatNumber type="percent" value="${examination.score }" />
						</div>
						</td>
					</c:if>
				</tr>		
			</c:forEach>
			<tr><td colspan="6" >
				<div style="width:100%;text-align: right;">
					<label><input type="checkbox"   onclick="showQuestion(this.checked,'.correct')" class="language"/>显示正确的题</label>	
					<label><input type="checkbox"   onclick="showQuestion(this.checked,'.wrong')" class="language"/>显示错题</label>
				</div>
			
			</td></tr>
		</table>
		</div>
		<div id="allquests" >
		
		<c:forEach var="quest"  varStatus="temp" items="${examination.questions}">
			<c:set var="wclass" value="question correct"></c:set> 
			<c:if test="${!quest.answerInfo.correct}"> 
				<c:set var="wclass" value="question wrong"></c:set> 
			</c:if>
			<div class="${wclass }" id="${quest.id}" style="display: none;">
			<input type="hidden"   id="answer${quest.id}"/>
			<span>[ 试题编号：${quest.no }&nbsp;&nbsp;&nbsp;&nbsp;章节：<z:dic code="${quest.chapter }"/> ]</span>
				<ul>
					<c:if test="${fn:length(quest.accessorys)>0}">
					<li class="english">
						<dt class="title">
							<span class="no">${temp.index+1}.</span>&nbsp;<c:out value="${quest.accessorys[0].summary }"/>
						</dt> 
						<c:forEach var="opt" items="${quest.accessorys[0].options }">
							<dd class="option">
								<label>	${opt.no}.&nbsp;<span><c:out value="${opt.summary }"/></span></label>
							</dd>
						</c:forEach>
					</li>
					</c:if>
					<li class="chinese">
						<dt class="title">
							<span class="no">${temp.index+1}.</span>&nbsp;
							<c:out value="${quest.summary }"/>
						</dt> 
						<c:forEach var="opt"  items="${quest.options }">
						<dd class="option">
							<label>${opt.no}.&nbsp;<span><c:out value="${opt.summary }"/></span></label>
						</dd>
						</c:forEach>
					</li>
				</ul>
				<div class="help radius" style="display: block;" align="left">
						<div class=" left">
							<span class="answer" style="display: inline;">正确答案：	<c:out value="${quest.answer }"/>  </span>
							<span style="color: #999 ;margin-left: 30px;" >(你的答案：<c:out value="${quest.answerInfo.userAnswer }"/>)  </span>
						</div> 
						
						<div  class="right" style="color:black;margin-right: 20px;"> 章节： <z:dic code="${quest.chapter}"  />	</div>
						<div class="analysis clear" style="background: white;min-height: 50px;">
							<c:out value="${quest.analysis }"/>
						</div>
				</div>
			</div>
			</c:forEach>
			</div>
		</div>
	</div>
	<%@include file="../core/bottom.jsp"%>
</body>
</html>
